package com.loong.java.json.regex;



import org.codehaus.jackson.map.ObjectMapper;
import scala.Tuple4;

import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;

/**
 * Created by 梁浩峰 on 2016/9/14 16:17.
 */
public class JacksonRegex {
    public static Tuple4<String,String,String,String> jsonRegx(String json){
        ObjectMapper objectMapper = new ObjectMapper();
        log log=null;
        List<LinkedHashMap<String, String>> list =null;
        try {
            list = objectMapper.readValue(json, List.class);
        } catch (IOException e) {
            e.printStackTrace();
        }
        LinkedHashMap<String, String> map = list.get(0);
        return new Tuple4<String, String, String, String>(map.get("send_time").toString(),map.get("send_log_info").toString(),map.get("log_level").toString(),map.get("send_log_address").toString());
    }
}

class log{
    private String send_time;
    private String send_log_info;
    private String log_level;
    private String send_log_address;

    public String getSend_time() {
        return send_time;
    }

    public void setSend_time(String send_time) {
        this.send_time = send_time;
    }

    public String getSend_log_info() {
        return send_log_info;
    }

    public void setSend_log_info(String send_log_info) {
        this.send_log_info = send_log_info;
    }

    public String getLog_level() {
        return log_level;
    }

    public void setLog_level(String log_level) {
        this.log_level = log_level;
    }

    public String getSend_log_address() {
        return send_log_address;
    }

    public void setSend_log_address(String send_log_address) {
        this.send_log_address = send_log_address;
    }

    public log() {
    }
}